<?php

namespace addons\travel\controller;

use addons\sum\controller\Base;
use think\Db;
use think\Config as FaConfig;
use fast\Random;
use think\exception\HttpResponseException;

class Index extends Base
{

    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function index()
    {
    }

    public function init()
    {
        $site = FaConfig::get('site');
        $return['site_name']=$site['name'];
        $return['car_seat_arr']=json_decode($site['car_seat_arr'],true);
        $return['trip_day_arr']=json_decode($site['trip_day_arr'],true);
        $return['lang_default_api']=$site['lang_default_api'];
        $lang_slug=$this->langSlug;
        if($lang_slug=='zh_cn'){
            $company_name=$site['company_name'];
            $company_service=$site['company_service'];
        }elseif($lang_slug=='zh_tw'){
            $company_name=$site['company_name_zh_tw'];
            $company_service=$site['company_service_zh_tw'];
        }elseif($lang_slug=='en'){
            $company_name=$site['company_name_en'];
            $company_service=$site['company_service_en'];
        }
        $return['company_name']=$company_name;
        $return['company_phone']=$site['company_phone'];
        $return['company_service']=$company_service;
        $return['company_time']=$site['company_time'];
        $this->success('初始化数据', $return);
    }


}
